home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / BEEPS.ASM < prev    next >
Assembly Source File  |  1993-05-04  |  1KB  |  65 lines

  1. ;***********************;
  2. ; SESSION Sound Effects ;
  3. ;    By Eric Tauck      ;
  4. ;***********************;
  5.  
  6. sndflg  DW      1       ;sound on
  7.  
  8. ;========================================
  9. ; Various beeps.
  10.  
  11. ;--- standard beep
  12.  
  13. Beep_Std PROC   NEAR
  14.         mov     ax, 1046        ;frequency
  15.         mov     bx, 1           ;duration
  16.         call    Beep            ;sound speaker
  17.         ret
  18.         ENDP
  19.  
  20. ;--- invalid keystroke beep
  21.  
  22. Beep_Key PROC   NEAR
  23.         mov     ax, 1569        ;frequency
  24.         mov     bx, 1           ;duration
  25.         call    Beep            ;sound speaker
  26.         ret
  27.         ENDP
  28.  
  29. ;--- error beep
  30.  
  31. Beep_Error PROC NEAR
  32.         mov     ax, 800         ;frequency
  33.         mov     bx, 2           ;duration
  34.         call    Beep            ;sound speaker
  35.         ret
  36.         ENDP
  37.  
  38. ;--- successful transfer beep
  39.  
  40. Beep_Success PROC NEAR
  41.         call    Beep_Std
  42.         call    Beep_Error
  43.         call    Beep_Key
  44.         ret
  45.         ENDP
  46.  
  47. ;========================================
  48. ; Beep.
  49. ;
  50. ; In: AX= frequency; BX= duration in
  51. ;     ticks.
  52.  
  53. Beep    PROC    NEAR
  54.         cmp     sndflg, 0
  55.         je      beep1
  56.  
  57.         push    bx
  58.         call    SndOn           ;turn speaker on
  59.         pop     ax
  60.         call    TicWai          ;pause
  61.         call    SndOff          ;turn speaker off
  62.  
  63. beep1   ret
  64.         ENDP
  65.